From: Brian May <bam@debian.org>
Date: Wed, 26 Apr 2017 06:29:23 +1000
Subject: Link Gssapi

Link against just build gssapi, instead of the system one this resolves
FTBFS when gssapi adds new symbols.

Author: Dimitri John Ledkov <xnox@ubuntu.com>
---
 kadmin/Makefile.am    | 1 +
 kdc/Makefile.am       | 4 ++++
 kpasswd/Makefile.am   | 1 +
 lib/hdb/Makefile.am   | 1 +
 lib/kadm5/Makefile.am | 2 ++
 5 files changed, 9 insertions(+)

diff --git a/kadmin/Makefile.am b/kadmin/Makefile.am
index 74a2d54..337bb52 100644
--- a/kadmin/Makefile.am
+++ b/kadmin/Makefile.am
@@ -62,6 +62,7 @@ check_PROGRAMS = $(TESTS)
 LDADD_common = \
 	$(top_builddir)/lib/hdb/libhdb.la \
 	$(top_builddir)/lib/krb5/libkrb5.la \
+	$(LIB_gssapi) \
 	$(LIB_hcrypto) \
 	$(top_builddir)/lib/asn1/libasn1.la \
 	$(LIB_roken) \
diff --git a/kdc/Makefile.am b/kdc/Makefile.am
index 842b5a8..465d1bc 100644
--- a/kdc/Makefile.am
+++ b/kdc/Makefile.am
@@ -84,6 +84,7 @@ hprop_LDADD = \
 	$(top_builddir)/lib/hdb/libhdb.la \
 	$(top_builddir)/lib/krb5/libkrb5.la \
 	$(LIB_kdb)  \
+	$(LIB_gssapi) \
 	$(LIB_hcrypto) \
 	$(top_builddir)/lib/asn1/libasn1.la \
 	$(LIB_roken) \
@@ -93,6 +94,7 @@ hpropd_LDADD = \
 	$(top_builddir)/lib/hdb/libhdb.la \
 	$(top_builddir)/lib/krb5/libkrb5.la \
 	$(LIB_kdb)  \
+	$(LIB_gssapi) \
 	$(LIB_hcrypto) \
 	$(top_builddir)/lib/asn1/libasn1.la \
 	$(LIB_roken) \
@@ -108,6 +110,7 @@ libkdc_la_LIBADD = \
 	$(top_builddir)/lib/krb5/libkrb5.la \
 	$(LIB_kdb)  \
 	$(top_builddir)/lib/ntlm/libheimntlm.la \
+	$(LIB_gssapi) \
 	$(LIB_hcrypto) \
 	$(LIB_openssl_crypto) \
 	$(top_builddir)/lib/asn1/libasn1.la \
@@ -116,6 +119,7 @@ libkdc_la_LIBADD = \
 
 LDADD = $(top_builddir)/lib/hdb/libhdb.la \
 	$(top_builddir)/lib/krb5/libkrb5.la \
+	$(LIB_gssapi) \
 	$(LIB_hcrypto) \
 	$(top_builddir)/lib/asn1/libasn1.la \
 	$(LIB_roken) \
diff --git a/kpasswd/Makefile.am b/kpasswd/Makefile.am
index 88132df..7b85dfc 100644
--- a/kpasswd/Makefile.am
+++ b/kpasswd/Makefile.am
@@ -23,6 +23,7 @@ kpasswdd_LDADD = \
 	$(DB3LIB) $(DB1LIB) $(LMDBLIB) $(NDBMLIB)
 
 LDADD = $(top_builddir)/lib/krb5/libkrb5.la \
+	$(LIB_gssapi) \
 	$(LIB_hcrypto) \
 	$(top_builddir)/lib/asn1/libasn1.la \
 	$(LIB_roken)
diff --git a/lib/hdb/Makefile.am b/lib/hdb/Makefile.am
index 448b024..74bc107 100644
--- a/lib/hdb/Makefile.am
+++ b/lib/hdb/Makefile.am
@@ -43,6 +43,7 @@ CLEANFILES = $(BUILT_SOURCES) $(gen_files_hdb) \
 LDADD = libhdb.la \
 	../krb5/libkrb5.la \
 	../asn1/libasn1.la \
+	$(LIB_gssapi) \
 	$(LIB_hcrypto) \
 	$(LIB_roken) \
 	$(LIB_openldap) \
diff --git a/lib/kadm5/Makefile.am b/lib/kadm5/Makefile.am
index 9d8aba0..8ae1d1d 100644
--- a/lib/kadm5/Makefile.am
+++ b/lib/kadm5/Makefile.am
@@ -138,6 +138,7 @@ LDADD = \
 	$(top_builddir)/lib/hdb/libhdb.la \
 	$(top_builddir)/lib/krb5/libkrb5.la \
 	$(top_builddir)/lib/asn1/libasn1.la \
+	$(LIB_gssapi) \
 	$(LIB_hcrypto) \
 	$(LIB_roken) \
 	$(DB3LIB) $(DB1LIB) $(LMDBLIB) $(NDBMLIB) \
@@ -149,6 +150,7 @@ iprop_log_LDADD = \
 	$(top_builddir)/lib/hdb/libhdb.la \
 	$(top_builddir)/lib/krb5/libkrb5.la \
 	$(top_builddir)/lib/asn1/libasn1.la \
+	$(LIB_gssapi) \
 	$(LIB_hcrypto) \
 	$(top_builddir)/lib/sl/libsl.la \
 	$(LIB_readline) \
